#ifndef ANDRES_LFM_IPM_H
#define ANDRES_LFM_IPM_H

#include <base/camera.h>
#include <base/defines.h>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Core>

namespace LFM
{
    /*------------------------------------------------------------------
    - [Reference]:
    -   "Multimodal inverse perspective mapping", 
    -   ELSEVIER. Information Fusion, 2015
    - Use fixed 3D ground plane for inverse mapping
    -------------------------------------------------------------------*/
    class IPM
    {
    public:
        void CalMatrix(const Camera &camera);
        Eigen::Vector3d Mapping(const Eigen::Vector2d& uv);
    private:
        Eigen::Matrix4d A_;
        Eigen::Vector4d b_;
    };
}

#endif